package com.rent.writeoff.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;

/**
 * 核销结果返回VO
 */
@Data
@ApiModel(value = "核销结果", description = "批量核销任务的汇总结果")
public class WriteOffResultVO {
    @ApiModelProperty(value = "任务编号", example = "WO20251020100000ABC123")
    private String taskNo;

    @ApiModelProperty(value = "核销总笔数", example = "100")
    private int totalCount = 0;

    @ApiModelProperty(value = "核销总本金", example = "500000.00")
    private BigDecimal totalPrincipal = BigDecimal.ZERO;

    @ApiModelProperty(value = "核销总利息", example = "100000.00")
    private BigDecimal totalInterest = BigDecimal.ZERO;

    @ApiModelProperty(value = "总耗时(秒)", example = "300.50")
    private double totalTimeSeconds;

    @ApiModelProperty(value = "处理消息", example = "核销成功")
    private String message;

    public void addStatistic(WriteOffStatisticVO stat) {
        this.totalCount += stat.getCount();
        this.totalPrincipal = this.totalPrincipal.add(stat.getPrincipal());
        this.totalInterest = this.totalInterest.add(stat.getInterest());
    }
}
